import { useState } from "react";
import Child from "./components/child";
const data = [
  {
    key: "1",
    name: "John Brown",
    age: 32,
    address: "New York No. 1 Lake Park",
    tags: ["nice", "developer"],
  },
  {
    key: "2",
    name: "Jim Green",
    age: 42,
    address: "London No. 1 Lake Park",
    tags: ["loser"],
  },
  {
    key: "3",
    name: "Joe Black",
    age: 32,
    address: "Sydney No. 1 Lake Park",
    tags: ["cool", "teacher"],
  },
];
const columns = [
  {
    title: "Name",
    dataIndex: "name",
    key: "name",
    render: (text) => <a>{text}</a>,
  },
  {
    title: "Age",
    dataIndex: "age",
    key: "age",
  },
  {
    title: "Address",
    key: "address",
  },
];
const test3 = () => {
  const [testData, setTestData] = useState(0);
  const getTestData = (value) => {
    setTestData(value);
  };
  return (
    <>
      <div>
        <Child columns={columns} getTestData={getTestData}></Child>
        {testData === 1 && (
          <>
            <span>hah</span>
          </>
        )}
      </div>
    </>
  );
};
export default test3;
